home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / dpmigcc5.zip / RSX / SOURCE / PROCESS.S < prev    next >
Text File  |  1994-12-12  |  25KB  |  1,568 lines

  1.     .file    "process"
  2. gcc2_compiled.:
  3. ___gnu_compiled_c:
  4. .globl _current_pid
  5. .data
  6.     .align 2
  7. _current_pid:
  8.     .long 1
  9. .lcomm _inited.2,4
  10. .text
  11.     .align 2,0x90
  12. _alloc_kernel_stack:
  13.     pushl %ebp
  14.     movl %esp,%ebp
  15.     movl _stackp16,%eax
  16.     addl $-1024,%eax
  17.     movb $0,%al
  18.     cmpl $0,_inited.2
  19.     jne L2
  20.     movl $1,_inited.2
  21.     addl $-43008,%eax
  22.     movl $14,%edx
  23.     .align 2,0x90
  24. L6:
  25.     movl %eax,_kstk(,%edx,2)
  26.     addl $6144,%eax
  27.     addl $-2,%edx
  28.     jns L6
  29. L2:
  30.     movl $_kstk,%eax
  31.     movl $_stack_used,%edx
  32.     movl $_kstk+28,%ecx
  33.     .align 2,0x90
  34. L11:
  35.     cmpb $0,(%edx)
  36.     jne L10
  37.     movb $1,(%edx)
  38.     movl (%eax),%eax
  39.     leave
  40.     ret
  41.     .align 2,0x90
  42. L10:
  43.     addl $4,%eax
  44.     incl %edx
  45.     cmpl %ecx,%eax
  46.     jle L11
  47.     xorl %eax,%eax
  48.     leave
  49.     ret
  50.     .align 2,0x90
  51. _free_kernel_stack:
  52.     pushl %ebp
  53.     movl %esp,%ebp
  54.     movl 8(%ebp),%ecx
  55.     xorl %eax,%eax
  56.     movl $_kstk,%edx
  57.     .align 2,0x90
  58. L19:
  59.     cmpl %ecx,(%edx)
  60.     jne L18
  61.     movb $0,_stack_used(%eax)
  62.     leave
  63.     ret
  64.     .align 2,0x90
  65. L18:
  66.     addl $4,%edx
  67.     incl %eax
  68.     cmpl $7,%eax
  69.     jle L19
  70.     leave
  71.     ret
  72. LC0:
  73.     .ascii "\12%d -> %d, %lX -> %lX\12\0"
  74. LC1:
  75.     .ascii "\12pid %d kst %lX\12\0"
  76.     .align 2,0x90
  77. .globl _switch_context
  78. _switch_context:
  79.     pushl %ebp
  80.     movl %esp,%ebp
  81.     pushl %esi
  82.     pushl %ebx
  83.     movl 8(%ebp),%esi
  84.     cmpb $0,_opt_printall
  85.     je L23
  86.     pushl 84(%esi)
  87.     movl _npz,%eax
  88.     pushl 84(%eax)
  89.     pushl 456(%esi)
  90.     pushl 456(%eax)
  91.     pushl $LC0
  92.     call _printf
  93.     addl $20,%esp
  94. L23:
  95.     movl _npz,%eax
  96.     cmpl $1,460(%eax)
  97.     je L24
  98. /APP
  99.     pusha ; movl %esp, 84(%ebx)
  100. /NO_APP
  101. L24:
  102.     movl %esi,_npz
  103.     movl %esi,%ebx
  104.     movl 56(%ebx),%eax
  105.     cmpl %eax,552(%ebx)
  106.     jne L25
  107. /APP
  108.     movl 84(%ebx), %esp
  109. /NO_APP
  110.     call _back_from_syscall
  111.     jmp L26
  112.     .align 2,0x90
  113. L25:
  114. /APP
  115.     movl 84(%ebx), %esp ; popa ; nop 
  116. /NO_APP
  117. L26:
  118.     cmpb $0,_opt_printall
  119.     je L27
  120.     movl 84(%ebx),%eax
  121.     pushl %eax
  122.     movl 456(%ebx),%eax
  123.     pushl %eax
  124.     pushl $LC1
  125.     call _printf
  126. L27:
  127.     leal -8(%ebp),%esp
  128.     popl %ebx
  129.     popl %esi
  130.     leave
  131.     ret
  132. .data
  133.     .align 2
  134. _last.9:
  135.     .long _process+916
  136. .text
  137. LC2:
  138.     .ascii "schedule:\0"
  139. LC3:
  140.     .ascii "pid = %d status = %d stack %lX\12\0"
  141. LC4:
  142.     .ascii "schedule: no other process found\12\0"
  143.     .align 2,0x90
  144. .globl _schedule
  145. _schedule:
  146.     pushl %ebp
  147.     movl %esp,%ebp
  148.     pushl %esi
  149.     pushl %ebx
  150.     xorl %esi,%esi
  151.     cmpb $0,_opt_schedule
  152.     je L46
  153.     cmpb $0,_opt_printall
  154.     je L30
  155.     pushl $LC2
  156.     call _puts
  157.     movl $_process+916,%ebx
  158.     addl $4,%esp
  159.     cmpl $_process+7328,%ebx
  160.     ja L30
  161.     .align 2,0x90
  162. L34:
  163.     cmpl $0,456(%ebx)
  164.     je L33
  165.     pushl 84(%ebx)
  166.     pushl 460(%ebx)
  167.     pushl 456(%ebx)
  168.     pushl $LC3
  169.     call _printf
  170.     addl $16,%esp
  171. L33:
  172.     addl $916,%ebx
  173.     cmpl $_process+7328,%ebx
  174.     jbe L34
  175. L30:
  176.     movl _last.9,%ebx
  177.     cmpl $2,460(%ebx)
  178.     jne L40
  179.     cmpl %ebx,_npz
  180.     jne L48
  181.     .align 2,0x90
  182. L40:
  183.     addl $916,%ebx
  184.     cmpl $_process+7328,%ebx
  185.     jbe L39
  186.     movl $_process+916,%ebx
  187. L39:
  188.     cmpl %ebx,_last.9
  189.     je L38
  190.     cmpl $2,460(%ebx)
  191.     jne L40
  192.     cmpl %ebx,_npz
  193.     je L40
  194.     movl $1,%esi
  195. L38:
  196.     testl %esi,%esi
  197.     je L44
  198. L48:
  199.     movl %ebx,_last.9
  200.     pushl %ebx
  201.     call _switch_context
  202.     movl $1,%eax
  203.     jmp L47
  204.     .align 2,0x90
  205. L44:
  206.     cmpb $0,_opt_printall
  207.     je L46
  208.     pushl $LC4
  209.     call _printf
  210. L46:
  211.     xorl %eax,%eax
  212. L47:
  213.     leal -8(%ebp),%esp
  214.     popl %ebx
  215.     popl %esi
  216.     leave
  217.     ret
  218.     .align 2,0x90
  219. .globl _init_this_process
  220. _init_this_process:
  221.     pushl %ebp
  222.     movl %esp,%ebp
  223.     movl $_process+916,%eax
  224.     cmpl $_process+7328,%eax
  225.     ja L51
  226.     .align 2,0x90
  227. L53:
  228.     movl $0,460(%eax)
  229.     addl $916,%eax
  230.     cmpl $_process+7328,%eax
  231.     jbe L53
  232. L51:
  233.     movl $_process,_npz
  234.     movl _current_pid,%eax
  235.     movl %eax,_process+456
  236.     incl _current_pid
  237.     movl $2,_process+460
  238.     movl $256,_process+464
  239.     movl _stackp16,%eax
  240.     movl %eax,_process+84
  241.     call _init_rsx_filetab
  242.     movl _npz,%eax
  243.     movl $_rsx_filetab,576(%eax)
  244.     movl $_rsx_filetab+20,580(%eax)
  245.     movl $_rsx_filetab+40,584(%eax)
  246.     leave
  247.     ret
  248.     .align 2,0x90
  249. _find_empty_process:
  250.     pushl %ebp
  251.     movl %esp,%ebp
  252.     movl $_process+916,%eax
  253.     cmpl $_process+7328,%eax
  254.     ja L57
  255.     .align 2,0x90
  256. L59:
  257.     cmpl $0,460(%eax)
  258.     je L62
  259.     addl $916,%eax
  260.     cmpl $_process+7328,%eax
  261.     jbe L59
  262. L57:
  263.     xorl %eax,%eax
  264. L62:
  265.     leave
  266.     ret
  267.     .align 2,0x90
  268. .globl _verify_illegal
  269. _verify_illegal:
  270.     pushl %ebp
  271.     movl %esp,%ebp
  272.     movl 8(%ebp),%edx
  273.     movl 12(%ebp),%eax
  274.     movl 16(%ebp),%ecx
  275.     cmpb $0,464(%edx)
  276.     jge L64
  277.     cmpl $167,%eax
  278.     jbe L66
  279. L71:
  280.     addl %ecx,%eax
  281.     cmpl %eax,480(%edx)
  282.     ja L67
  283. L66:
  284.     movl $1,%eax
  285.     leave
  286.     ret
  287.     .align 2,0x90
  288. L64:
  289.     cmpl $4095,%eax
  290.     jbe L66
  291.     jmp L71
  292.     .align 2,0x90
  293. L67:
  294.     xorl %eax,%eax
  295.     leave
  296.     ret
  297.     .align 2,0x90
  298. .globl _verify_illegal_write
  299. _verify_illegal_write:
  300.     pushl %ebp
  301.     movl %esp,%ebp
  302.     movl 8(%ebp),%edx
  303.     movl 12(%ebp),%ecx
  304.     movl %ecx,%eax
  305.     addl 16(%ebp),%eax
  306.     cmpl %ecx,500(%edx)
  307.     jbe L74
  308.     cmpl %eax,504(%edx)
  309.     jbe L73
  310. L74:
  311.     xorl %eax,%eax
  312.     leave
  313.     ret
  314.     .align 2,0x90
  315. L73:
  316.     cmpl %ecx,536(%edx)
  317.     jbe L74
  318.     cmpl %eax,532(%edx)
  319.     ja L74
  320.     cmpl %ecx,544(%edx)
  321.     jbe L74
  322.     cmpl %eax,548(%edx)
  323.     ja L74
  324.     movl $1,%eax
  325.     leave
  326.     ret
  327.     .align 2,0x90
  328. .globl _find_process
  329. _find_process:
  330.     pushl %ebp
  331.     movl %esp,%ebp
  332.     movl 8(%ebp),%edx
  333.     movl $_process+916,%eax
  334.     cmpl $_process+7328,%eax
  335.     ja L82
  336.     .align 2,0x90
  337. L84:
  338.     cmpl %edx,456(%eax)
  339.     je L87
  340.     addl $916,%eax
  341.     cmpl $_process+7328,%eax
  342.     jbe L84
  343. L82:
  344.     xorl %eax,%eax
  345. L87:
  346.     leave
  347.     ret
  348.     .align 2,0x90
  349. .globl _sys_wait
  350. _sys_wait:
  351.     pushl %ebp
  352.     movl %esp,%ebp
  353.     pushl %esi
  354.     pushl %ebx
  355.     movl 8(%ebp),%esi
  356.     movl $-1,%ebx
  357.     .align 2,0x90
  358. L89:
  359.     movl $_process+7328,%ecx
  360.     cmpl $_process+916,%ecx
  361.     jb L93
  362.     movl $_process+7788,%edx
  363.     .align 2,0x90
  364. L95:
  365.     movl -12(%edx),%eax
  366.     cmpl %eax,_npz
  367.     jne L94
  368.     testb $8,4(%edx)
  369.     je L94
  370.     movl 8(%edx),%eax
  371.     movl %eax,(%esi)
  372.     movl -4(%edx),%ebx
  373.     andl $-9,4(%edx)
  374.     cmpl $1,(%edx)
  375.     jne L93
  376.     pushl %ecx
  377.     call _clean_processtable
  378.     addl $4,%esp
  379.     jmp L93
  380.     .align 2,0x90
  381. L94:
  382.     addl $-916,%edx
  383.     addl $-916,%ecx
  384.     cmpl $_process+916,%ecx
  385.     jae L95
  386. L93:
  387.     testl %ebx,%ebx
  388.     jge L90
  389.     movl _npz,%eax
  390.     movl $4,460(%eax)
  391.     call _schedule
  392.     testl %eax,%eax
  393.     jne L89
  394.     movl _npz,%eax
  395.     movl $2,460(%eax)
  396. L90:
  397.     movl %ebx,%eax
  398.     leal -8(%ebp),%esp
  399.     popl %ebx
  400.     popl %esi
  401.     leave
  402.     ret
  403.     .align 2,0x90
  404. .globl _sys_waitpid
  405. _sys_waitpid:
  406.     pushl %ebp
  407.     movl %esp,%ebp
  408.     pushl %edi
  409.     pushl %esi
  410.     pushl %ebx
  411.     movl $-1,%edi
  412.     cmpl $-1,8(%ebp)
  413.     jne L104
  414.     movl $-1,%eax
  415.     jmp L118
  416.     .align 2,0x90
  417. L104:
  418.     movl $_process+7328,%esi
  419.     cmpl $_process+916,%esi
  420.     jb L106
  421.     movl $_process+7788,%ebx
  422.     .align 2,0x90
  423. L108:
  424.     movl 8(%ebp),%edx
  425.     cmpl %edx,-4(%ebx)
  426.     jne L107
  427.     .align 2,0x90
  428. L110:
  429.     testb $8,4(%ebx)
  430.     je L113
  431.     movl 8(%ebx),%eax
  432.     movl 12(%ebp),%edx
  433.     movl %eax,(%edx)
  434.     movl -4(%ebx),%edi
  435.     andl $-9,4(%ebx)
  436.     cmpl $1,(%ebx)
  437.     jne L107
  438.     pushl %esi
  439.     call _clean_processtable
  440.     addl $4,%esp
  441.     jmp L107
  442.     .align 2,0x90
  443. L113:
  444.     movl _npz,%eax
  445.     movl $4,460(%eax)
  446.     call _schedule
  447.     testl %eax,%eax
  448.     jne L112
  449.     movl _npz,%eax
  450.     movl $2,460(%eax)
  451.     jmp L107
  452.     .align 2,0x90
  453. L112:
  454.     cmpl $-1,%edi
  455.     jne L110
  456. L107:
  457.     addl $-916,%ebx
  458.     addl $-916,%esi
  459.     cmpl $_process+916,%esi
  460.     jae L108
  461. L106:
  462.     movl %edi,%eax
  463. L118:
  464.     leal -12(%ebp),%esp
  465.     popl %ebx
  466.     popl %esi
  467.     popl %edi
  468.     leave
  469.     ret
  470.     .align 2,0x90
  471. .globl _free_process
  472. _free_process:
  473.     pushl %ebp
  474.     movl %esp,%ebp
  475.     pushl %ebx
  476.     movl 8(%ebp),%ebx
  477.     cmpl $0,472(%ebx)
  478.     je L119
  479.     pushl 484(%ebx)
  480.     call _FreeMem
  481.     pushl 472(%ebx)
  482.     call _FreeLDT
  483.     pushl 476(%ebx)
  484.     call _FreeLDT
  485.     movl 476(%ebx),%eax
  486.     addl _sel_incr,%eax
  487.     pushl %eax
  488.     call _FreeLDT
  489.     movl $0,472(%ebx)
  490.     addl $16,%esp
  491.     testb $2,465(%ebx)
  492.     je L119
  493.     movzwl 516(%ebx),%eax
  494.     pushl %eax
  495.     call _rm_close
  496. L119:
  497.     movl -4(%ebp),%ebx
  498.     leave
  499.     ret
  500.     .align 2,0x90
  501. .globl _clean_processtable
  502. _clean_processtable:
  503.     pushl %ebp
  504.     movl %esp,%ebp
  505.     pushl $916
  506.     pushl $0
  507.     pushl 8(%ebp)
  508.     call _memset
  509.     leave
  510.     ret
  511.     .align 2,0x90
  512. _switch_to_process:
  513.     pushl %ebp
  514.     movl %esp,%ebp
  515.     pushl %ebx
  516.     movl 8(%ebp),%ebx
  517.     movl _npz,%eax
  518.     testb $2,464(%eax)
  519.     je L124
  520.     cmpb $3,_copro
  521.     jne L125
  522.     pushl %eax
  523.     call _save_emu_state
  524.     jmp L136
  525.     .align 2,0x90
  526. L125:
  527.     cmpb $1,_copro
  528.     jne L124
  529.     movl _npz,%eax
  530.     addl $744,%eax
  531.     pushl %eax
  532.     call _do_fnsave
  533. L136:
  534.     addl $4,%esp
  535. L124:
  536.     movl %ebx,_npz
  537.     movl $0,_cbrkcall
  538.     cmpb $3,_copro
  539.     jne L128
  540.     cmpl $0,744(%ebx)
  541.     je L129
  542.     orb $2,464(%ebx)
  543.     pushl %ebx
  544.     call _load_emu_state
  545.     addl $4,%esp
  546. L129:
  547.     movl _npz,%eax
  548.     testb $2,464(%eax)
  549.     je L130
  550.     movl 464(%eax),%eax
  551.     andl $1,%eax
  552.     pushl %eax
  553.     pushl $1
  554.     call _emu_switch
  555.     jmp L132
  556.     .align 2,0x90
  557. L130:
  558.     movl 464(%eax),%eax
  559.     andl $1,%eax
  560.     pushl %eax
  561.     pushl $0
  562.     call _emu_switch
  563.     jmp L132
  564.     .align 2,0x90
  565. L128:
  566.     cmpb $1,_copro
  567.     jne L132
  568.     testb $2,464(%ebx)
  569.     je L134
  570.     movl _npz,%eax
  571.     addl $744,%eax
  572.     pushl %eax
  573.     call _do_frstor
  574.     movl _npz,%eax
  575.     orb $2,464(%eax)
  576.     jmp L132
  577.     .align 2,0x90
  578. L134:
  579.     call _do_fninit
  580. L132:
  581.     xorl %eax,%eax
  582.     movl -4(%ebp),%ebx
  583.     leave
  584.     ret
  585.     .align 2,0x90
  586. _mk_cmdline:
  587.     pushl %ebp
  588.     movl %esp,%ebp
  589.     pushl %esi
  590.     pushl %ebx
  591.     movl 8(%ebp),%eax
  592.     movl 12(%ebp),%esi
  593.     cmpl $0,(%eax)
  594.     jne L138
  595.     movb $13,(%esi)
  596.     xorl %eax,%eax
  597.     jmp L148
  598.     .align 2,0x90
  599. L138:
  600.     xorl %ecx,%ecx
  601.     movl (%eax),%edx
  602.     testl %edx,%edx
  603.     je L140
  604.     movl %eax,%ebx
  605.     jmp L149
  606.     .align 2,0x90
  607.     .align 2,0x90
  608. L145:
  609.     movb (%edx),%al
  610.     movb %al,(%ecx,%esi)
  611.     incl %edx
  612.     incl %ecx
  613. L149:
  614.     cmpb $0,(%edx)
  615.     jne L145
  616.     movb $32,(%ecx,%esi)
  617.     incl %ecx
  618.     addl $4,%ebx
  619.     movl (%ebx),%edx
  620.     testl %edx,%edx
  621.     jne L149
  622. L140:
  623.     decl %ecx
  624.     movb $13,(%ecx,%esi)
  625.     movl %ecx,%eax
  626. L148:
  627.     leal -8(%ebp),%esp
  628.     popl %ebx
  629.     popl %esi
  630.     leave
  631.     ret
  632.     .align 2,0x90
  633. .globl _execute_realmode_prg
  634. _execute_realmode_prg:
  635.     pushl %ebp
  636.     movl %esp,%ebp
  637.     subl $144,%esp
  638.     pushl %edi
  639.     pushl %esi
  640.     pushl %ebx
  641.     movl 16(%ebp),%ebx
  642.     movl 20(%ebp),%edi
  643.     leal -144(%ebp),%esi
  644.     leal -142(%ebp),%eax
  645.     pushl %eax
  646.     movl 12(%ebp),%eax
  647.     addl $4,%eax
  648.     pushl %eax
  649.     call _mk_cmdline
  650.     incb %al
  651.     movb %al,-144(%ebp)
  652.     movb $32,-143(%ebp)
  653.     movl (%ebx),%eax
  654.     shrl $4,%eax
  655.     movw _ds16real,%dx
  656.     addw %ax,%dx
  657.     movw %dx,-16(%ebp)
  658.     movw _ds16real,%ax
  659.     movw %ax,-12(%ebp)
  660.     movw %si,-14(%ebp)
  661.     movw $0,-10(%ebp)
  662.     movw $0,-8(%ebp)
  663.     movw $0,-6(%ebp)
  664.     movw $0,-4(%ebp)
  665.     leal -16(%ebp),%eax
  666.     pushl %eax
  667.     pushl 8(%ebp)
  668.     call _rm_exec
  669.     movl %eax,(%edi)
  670.     addl $16,%esp
  671.     cmpl $-1,%eax
  672.     je L151
  673.     call _rm_get_exit_status
  674.     andl $255,%eax
  675.     movl %eax,(%edi)
  676.     xorl %eax,%eax
  677.     jmp L152
  678.     .align 2,0x90
  679. L151:
  680.     movl $-1,%eax
  681. L152:
  682.     leal -156(%ebp),%esp
  683.     popl %ebx
  684.     popl %esi
  685.     popl %edi
  686.     leave
  687.     ret
  688.     .align 2,0x90
  689. .globl _realmode_prg
  690. _realmode_prg:
  691.     pushl %ebp
  692.     movl %esp,%ebp
  693.     subl $4,%esp
  694.     pushl %edi
  695.     pushl %esi
  696.     pushl %ebx
  697.     xorl %ebx,%ebx
  698.     xorl %esi,%esi
  699.     movl _npz,%eax
  700.     cmpl $0,576(%eax)
  701.     je L154
  702.     movl 576(%eax),%eax
  703.     cmpw $0,6(%eax)
  704.     je L154
  705.     pushl $0
  706.     call _rm_dup
  707.     movl %eax,%ebx
  708.     pushl $0
  709.     movl _npz,%eax
  710.     movl 576(%eax),%eax
  711.     movzwl 6(%eax),%eax
  712.     pushl %eax
  713.     call _rm_dup2
  714.     addl $12,%esp
  715. L154:
  716.     movl _npz,%eax
  717.     cmpl $0,580(%eax)
  718.     je L155
  719.     movl 580(%eax),%eax
  720.     cmpw $1,6(%eax)
  721.     je L155
  722.     pushl $1
  723.     call _rm_dup
  724.     movl %eax,%esi
  725.     pushl $1
  726.     movl _npz,%eax
  727.     movl 580(%eax),%eax
  728.     movzwl 6(%eax),%eax
  729.     pushl %eax
  730.     call _rm_dup2
  731.     addl $12,%esp
  732. L155:
  733.     leal -4(%ebp),%eax
  734.     pushl %eax
  735.     pushl 16(%ebp)
  736.     pushl 12(%ebp)
  737.     pushl 8(%ebp)
  738.     call _execute_realmode_prg
  739.     movl %eax,%edi
  740.     addl $16,%esp
  741.     testl %ebx,%ebx
  742.     je L156
  743.     pushl $0
  744.     movl %ebx,%eax
  745.     movzwl %ax,%ebx
  746.     pushl %ebx
  747.     call _rm_dup2
  748.     pushl %ebx
  749.     call _rm_close
  750.     addl $12,%esp
  751. L156:
  752.     testl %esi,%esi
  753.     je L157
  754.     pushl $1
  755.     movl %esi,%eax
  756.     movzwl %ax,%ebx
  757.     pushl %ebx
  758.     call _rm_dup2
  759.     pushl %ebx
  760.     call _rm_close
  761.     addl $12,%esp
  762. L157:
  763.     testl %edi,%edi
  764.     jne L158
  765.     movl _npz,%eax
  766.     movzbl -4(%ebp),%edx
  767.     movl %edx,44(%eax)
  768.     incl _current_pid
  769.     xorl %eax,%eax
  770.     jmp L160
  771.     .align 2,0x90
  772. L158:
  773.     pushl -4(%ebp)
  774.     call _doserror_to_errno
  775. L160:
  776.     leal -16(%ebp),%esp
  777.     popl %ebx
  778.     popl %esi
  779.     popl %edi
  780.     leave
  781.     ret
  782.     .align 2,0x90
  783. _copy_filedescriptors:
  784.     pushl %ebp
  785.     movl %esp,%ebp
  786.     pushl %ebx
  787.     movl 8(%ebp),%ecx
  788.     movl 12(%ebp),%ebx
  789.     xorl %edx,%edx
  790.     .align 2,0x90
  791. L165:
  792.     cmpl $0,576(%ecx,%edx,4)
  793.     je L164
  794.     movl 576(%ecx,%edx,4),%eax
  795.     movl %eax,576(%ebx,%edx,4)
  796.     incw 4(%eax)
  797. L164:
  798.     incl %edx
  799.     cmpl $39,%edx
  800.     jle L165
  801.     movl -4(%ebp),%ebx
  802.     leave
  803.     ret
  804. .globl _stub_info
  805. .data
  806.     .align 2
  807. _stub_info:
  808.     .ascii "StubInfoMagic!!\0"
  809.     .long 68
  810.     .ascii "RSX\0"
  811.     .space 12
  812.     .byte 0
  813.     .byte 98
  814.     .byte 0
  815.     .byte 4
  816.     .long 262144
  817.     .long 0
  818.     .ascii "\0"
  819.     .space 14
  820.     .byte 0
  821.     .long 0
  822. .text
  823.     .align 2,0x90
  824. _set_go32_info_block:
  825.     pushl %ebp
  826.     movl %esp,%ebp
  827.     movl $40,_go32_info_block
  828.     movl $720896,_go32_info_block+4
  829.     movl $753664,_go32_info_block+8
  830.     movl _ds16real,%eax
  831.     sall $4,%eax
  832.     movl %eax,%edx
  833.     addl _iobuf,%edx
  834.     addl $4096,%edx
  835.     movl %edx,_go32_info_block+12
  836.     movl $4096,_go32_info_block+16
  837.     movl $42,_go32_info_block+20
  838.     movb $8,_go32_info_block+24
  839.     movb $70,_go32_info_block+25
  840.     movw _dosmem_sel,%dx
  841.     movw %dx,_go32_info_block+26
  842.     addl $_stub_info,%eax
  843.     movl %eax,_go32_info_block+28
  844.     movl _cs16real,%ecx
  845.     sall $4,%ecx
  846.     movl %ecx,_go32_info_block+32
  847.     movw $3,_go32_info_block+36
  848.     movw $144,_go32_info_block+38
  849.     leave
  850.     ret
  851. LC5:
  852.     .ascii "no kernel stack\0"
  853.     .align 2,0x90
  854. .globl _exec32
  855. _exec32:
  856.     pushl %ebp
  857.     movl %esp,%ebp
  858.     subl $4,%esp
  859.     pushl %edi
  860.     pushl %esi
  861.     pushl %ebx
  862.     movl 12(%ebp),%ebx
  863.     cmpb $0,_opt_schedule
  864.     jne L170
  865.     leal -4(%ebp),%eax
  866.     pushl %eax
  867.     call _sys_wait
  868.     addl $4,%esp
  869. L170:
  870.     call _find_empty_process
  871.     movl %eax,%esi
  872.     testl %esi,%esi
  873.     jne L171
  874.     movl $11,%eax
  875.     jmp L197
  876.     .align 2,0x90
  877. L171:
  878.     pushl %esi
  879.     pushl %ebx
  880.     call _load_protected_program
  881.     movl %eax,-4(%ebp)
  882.     addl $8,%esp
  883.     testl %eax,%eax
  884.     je L172
  885.     movl $0,460(%esi)
  886.     jmp L197
  887.     .align 2,0x90
  888. L172:
  889.     call _alloc_kernel_stack
  890.     movl %eax,84(%esi)
  891.     testl %eax,%eax
  892.     jne L173
  893.     pushl $LC5
  894.     call _puts
  895.     movl $0,460(%esi)
  896.     movl $11,%eax
  897.     jmp L197
  898.     .align 2,0x90
  899. L173:
  900.     pushl %ebx
  901.     pushl %esi
  902.     call _cpy_exename_to_stack
  903.     pushl %esi
  904.     pushl 28(%ebp)
  905.     pushl 24(%ebp)
  906.     pushl 20(%ebp)
  907.     pushl 16(%ebp)
  908.     call _argvenv
  909.     movl _current_pid,%eax
  910.     movl %eax,456(%esi)
  911.     incl _current_pid
  912.     movl _npz,%eax
  913.     movl %eax,448(%esi)
  914.     addl $28,%esp
  915.     cmpl $3,8(%ebp)
  916.     jne L174
  917.     orb $1,464(%esi)
  918. L174:
  919.     movl 552(%esi),%eax
  920.     movl %eax,56(%esi)
  921.     movl 540(%esi),%eax
  922.     movl %eax,28(%esi)
  923.     movl 540(%esi),%ecx
  924.     addl $-12,%ecx
  925.     movl %ecx,68(%esi)
  926.     movl _dosmem_sel,%eax
  927.     sall $16,%eax
  928.     orl $28680,%eax
  929.     movl %eax,44(%esi)
  930.     movl $0,32(%esi)
  931.     movl $0,40(%esi)
  932.     movl _ds16real,%eax
  933.     sall $4,%eax
  934.     addl $_go32_info_block,%eax
  935.     movl %eax,36(%esi)
  936.     movl $0,20(%esi)
  937.     movl $0,16(%esi)
  938.     movl $0,24(%esi)
  939.     movl 472(%esi),%eax
  940.     movl %eax,60(%esi)
  941.     movl 476(%esi),%eax
  942.     movl %eax,12(%esi)
  943.     movl 476(%esi),%eax
  944.     movl %eax,8(%esi)
  945.     cmpb $0,_opt_stack
  946.     jne L176
  947.     testb $2,465(%esi)
  948.     je L175
  949. L176:
  950.     movl 476(%esi),%eax
  951.     movl %eax,72(%esi)
  952.     jmp L177
  953.     .align 2,0x90
  954. L175:
  955.     movl 476(%esi),%ecx
  956.     addl _sel_incr,%ecx
  957.     movl %ecx,72(%esi)
  958. L177:
  959.     movl 476(%esi),%eax
  960.     movl %eax,4(%esi)
  961.     movl _dosmem_sel,%eax
  962.     movl %eax,(%esi)
  963.     movl $12802,64(%esi)
  964.     movl _time_tic,%eax
  965.     movl %eax,568(%esi)
  966.     movl _npz,%eax
  967.     movl %esi,452(%eax)
  968.     cmpb $0,464(%esi)
  969.     jge L178
  970.     call _set_go32_info_block
  971. L178:
  972.     pushl %esi
  973.     pushl _npz
  974.     call _copy_filedescriptors
  975.     movl _npz,%edi
  976.     movl %esi,_npz
  977.     xorl %ebx,%ebx
  978.     addl $8,%esp
  979.     .align 2,0x90
  980. L182:
  981.     movl %ebx,%edx
  982.     sarl $5,%edx
  983.     movl %ebx,%ecx
  984.     andl $31,%ecx
  985.     movl $1,%eax
  986.     sall %cl,%eax
  987.     testl %eax,736(%edi,%edx,4)
  988.     je L181
  989.     pushl %ebx
  990.     call _sys_close
  991.     addl $4,%esp
  992. L181:
  993.     incl %ebx
  994.     cmpl $39,%ebx
  995.     jle L182
  996.     movl %edi,_npz
  997.     testb $1,465(%edi)
  998.     je L185
  999.     call _djio_init
  1000.     movl $2,460(%esi)
  1001.     pushl %esi
  1002.     call _switch_context
  1003.     pushl $0
  1004.     call _shut_down
  1005.     addl $8,%esp
  1006. L185:
  1007.     cmpl $0,8(%ebp)
  1008.     jne L186
  1009.     movl _npz,%eax
  1010.     pushl 480(%eax)
  1011.     pushl 488(%eax)
  1012.     call _MarkPageDemand
  1013.     movl _npz,%eax
  1014.     movl $3,460(%eax)
  1015.     movl $2,460(%esi)
  1016.     pushl %esi
  1017.     call _switch_context
  1018.     movl _npz,%eax
  1019.     movl $2,460(%eax)
  1020.     andl $-2,64(%eax)
  1021.     cmpb $0,468(%esi)
  1022.     je L187
  1023.     movl $3,44(%eax)
  1024.     jmp L189
  1025.     .align 2,0x90
  1026. L187:
  1027.     movzbl 469(%esi),%esi
  1028.     movl %esi,44(%eax)
  1029.     jmp L189
  1030.     .align 2,0x90
  1031. L186:
  1032.     cmpl $1,8(%ebp)
  1033.     jne L190
  1034.     movl $2,460(%esi)
  1035.     cmpb $0,_opt_schedule
  1036.     jne L191
  1037.     pushl %esi
  1038.     call _switch_context
  1039. L191:
  1040.     movl _npz,%eax
  1041.     andl $-2,64(%eax)
  1042.     movl 456(%esi),%edx
  1043.     movl %edx,44(%eax)
  1044.     jmp L189
  1045.     .align 2,0x90
  1046. L190:
  1047.     cmpl $3,8(%ebp)
  1048.     jne L193
  1049.     movl _npz,%edx
  1050.     movl 456(%esi),%eax
  1051.     movl %eax,44(%edx)
  1052.     movl $3,460(%esi)
  1053.     jmp L189
  1054.     .align 2,0x90
  1055. L193:
  1056.     cmpl $2,8(%ebp)
  1057.     je L195
  1058.     movl $22,%eax
  1059.     jmp L197
  1060.     .align 2,0x90
  1061. L195:
  1062.     movl _npz,%ebx
  1063.     andl $-3,464(%ebx)
  1064.     pushl 448(%ebx)
  1065.     call _switch_to_process
  1066.     pushl %ebx
  1067.     call _free_process
  1068.     pushl %ebx
  1069.     call _clean_processtable
  1070.     movl _npz,%eax
  1071.     movl %esi,452(%eax)
  1072.     movl %eax,448(%esi)
  1073.     pushl %esi
  1074.     call _switch_to_process
  1075.     movl _npz,%eax
  1076.     movl $2,460(%eax)
  1077. L189:
  1078.     xorl %eax,%eax
  1079. L197:
  1080.     leal -16(%ebp),%esp
  1081.     popl %ebx
  1082.     popl %esi
  1083.     popl %edi
  1084.     leave
  1085.     ret
  1086.     .align 2,0x90
  1087. .globl _sys_fork
  1088. _sys_fork:
  1089.     pushl %ebp
  1090.     movl %esp,%ebp
  1091.     subl $8,%esp
  1092.     pushl %edi
  1093.     pushl %esi
  1094.     pushl %ebx
  1095.     call _find_empty_process
  1096.     movl %eax,-4(%ebp)
  1097.     testl %eax,%eax
  1098.     jne L199
  1099.     movl $-11,%eax
  1100.     jmp L208
  1101.     .align 2,0x90
  1102. L199:
  1103.     movl -4(%ebp),%edi
  1104.     movl _npz,%eax
  1105.     movl %eax,%esi
  1106.     cld
  1107.     movl $229,%ecx
  1108.     rep
  1109.     movsl
  1110.     movl -4(%ebp),%ecx
  1111.     movl $0,460(%ecx)
  1112.     call _alloc_kernel_stack
  1113.     movl -4(%ebp),%esi
  1114.     movl %eax,84(%esi)
  1115.     testl %eax,%eax
  1116.     jne L200
  1117.     pushl $LC5
  1118.     call _puts
  1119.     movl $-11,%eax
  1120.     jmp L208
  1121.     .align 2,0x90
  1122. L200:
  1123.     movl -4(%ebp),%ecx
  1124.     testb $2,465(%ecx)
  1125.     je L201
  1126.     movl %ecx,%eax
  1127.     addl $488,%eax
  1128.     pushl %eax
  1129.     movl %ecx,%eax
  1130.     addl $484,%eax
  1131.     pushl %eax
  1132.     pushl $0
  1133.     pushl $0
  1134.     movl _npz,%eax
  1135.     pushl 480(%eax)
  1136.     call _AllocLinearMemory
  1137.     addl $20,%esp
  1138.     jmp L209
  1139.     .align 2,0x90
  1140. L201:
  1141.     movl -4(%ebp),%eax
  1142.     addl $488,%eax
  1143.     pushl %eax
  1144.     movl -4(%ebp),%eax
  1145.     addl $484,%eax
  1146.     pushl %eax
  1147.     movl _npz,%eax
  1148.     pushl 480(%eax)
  1149.     call _AllocMem
  1150.     addl $12,%esp
  1151. L209:
  1152.     testl %eax,%eax
  1153.     je L203
  1154.     movl $-12,%eax
  1155.     jmp L208
  1156.     .align 2,0x90
  1157. L203:
  1158.     movl -4(%ebp),%eax
  1159.     addl $472,%eax
  1160.     pushl %eax
  1161.     pushl $3
  1162.     call _AllocLDT
  1163.     addl $8,%esp
  1164.     testl %eax,%eax
  1165.     je L205
  1166.     movl -4(%ebp),%esi
  1167.     pushl 484(%esi)
  1168.     call _FreeMem
  1169.     movl $-5,%eax
  1170.     jmp L208
  1171.     .align 2,0x90
  1172. L205:
  1173.     movl -4(%ebp),%ecx
  1174.     movl 472(%ecx),%esi
  1175.     addl _sel_incr,%esi
  1176.     movl %esi,476(%ecx)
  1177.     movw 476(%ecx),%bx
  1178.     addw _sel_incr,%bx
  1179.     pushl 488(%ecx)
  1180.     pushl 472(%ecx)
  1181.     call _SetBaseAddress
  1182.     movl -4(%ebp),%ecx
  1183.     pushl 488(%ecx)
  1184.     pushl 476(%ecx)
  1185.     call _SetBaseAddress
  1186.     movl -4(%ebp),%esi
  1187.     pushl 488(%esi)
  1188.     movzwl %bx,%ebx
  1189.     pushl %ebx
  1190.     call _SetBaseAddress
  1191.     pushl $192
  1192.     pushl $250
  1193.     pushl 472(%esi)
  1194.     call _SetAccess
  1195.     addl $36,%esp
  1196.     pushl $192
  1197.     pushl $242
  1198.     pushl 476(%esi)
  1199.     call _SetAccess
  1200.     pushl $192
  1201.     pushl $246
  1202.     pushl %ebx
  1203.     call _SetAccess
  1204.     movl _npz,%eax
  1205.     pushl 472(%eax)
  1206.     call _lsl32
  1207.     pushl %eax
  1208.     pushl 472(%esi)
  1209.     call _SetLimit
  1210.     addl $36,%esp
  1211.     movl _npz,%eax
  1212.     pushl 476(%eax)
  1213.     call _lsl32
  1214.     pushl %eax
  1215.     pushl 476(%esi)
  1216.     call _SetLimit
  1217.     movl _npz,%eax
  1218.     movzwl 72(%eax),%eax
  1219.     pushl %eax
  1220.     call _lsl32
  1221.     pushl %eax
  1222.     pushl %ebx
  1223.     call _SetLimit
  1224.     movl 472(%esi),%eax
  1225.     movl %eax,60(%esi)
  1226.     movl 476(%esi),%eax
  1227.     movl %eax,12(%esi)
  1228.     movl 476(%esi),%eax
  1229.     movl %eax,8(%esi)
  1230.     addl $24,%esp
  1231.     cmpb $0,_opt_stack
  1232.     jne L206
  1233.     testb $2,465(%esi)
  1234.     jne L206
  1235.     movl %ebx,72(%esi)
  1236.     jmp L207
  1237.     .align 2,0x90
  1238. L206:
  1239.     movl -4(%ebp),%ecx
  1240.     movl 476(%ecx),%eax
  1241.     movl %eax,72(%ecx)
  1242. L207:
  1243.     movl -4(%ebp),%esi
  1244.     movl 476(%esi),%eax
  1245.     movl %eax,4(%esi)
  1246.     movl _dosmem_sel,%eax
  1247.     movl %eax,(%esi)
  1248.     movl _current_pid,%ebx
  1249.     movl %ebx,456(%esi)
  1250.     incl _current_pid
  1251.     movl _npz,%edx
  1252.     movl %edx,448(%esi)
  1253.     movl $0,452(%esi)
  1254.     movl $0,572(%esi)
  1255.     movl _time_tic,%eax
  1256.     movl %eax,568(%esi)
  1257.     movl $0,516(%esi)
  1258.     movl 56(%esi),%eax
  1259.     movl %eax,552(%esi)
  1260.     movl %esi,452(%edx)
  1261.     pushl %esi
  1262.     pushl %edx
  1263.     call _copy_filedescriptors
  1264.     movl _npz,%edx
  1265.     movl 496(%edx),%eax
  1266.     subl 492(%edx),%eax
  1267.     pushl %eax
  1268.     pushl 492(%esi)
  1269.     movzwl 476(%esi),%eax
  1270.     pushl %eax
  1271.     pushl 492(%edx)
  1272.     movzwl 476(%edx),%eax
  1273.     pushl %eax
  1274.     call _cpy32_32
  1275.     movl _npz,%edx
  1276.     movl 504(%edx),%eax
  1277.     subl 500(%edx),%eax
  1278.     pushl %eax
  1279.     pushl 500(%esi)
  1280.     movzwl 476(%esi),%eax
  1281.     pushl %eax
  1282.     pushl 500(%edx)
  1283.     movzwl 476(%edx),%eax
  1284.     pushl %eax
  1285.     call _cpy32_32
  1286.     addl $48,%esp
  1287.     movl _npz,%edx
  1288.     movl 548(%edx),%eax
  1289.     subl 544(%edx),%eax
  1290.     pushl %eax
  1291.     pushl 544(%esi)
  1292.     movzwl 476(%esi),%eax
  1293.     pushl %eax
  1294.     pushl 544(%edx)
  1295.     movzwl 476(%edx),%eax
  1296.     pushl %eax
  1297.     call _cpy32_32
  1298.     movl _npz,%edx
  1299.     movl 532(%edx),%eax
  1300.     subl 68(%edx),%eax
  1301.     pushl %eax
  1302.     movl 68(%edx),%ecx
  1303.     pushl %ecx
  1304.     movzwl 476(%esi),%eax
  1305.     pushl %eax
  1306.     pushl %ecx
  1307.     movzwl 476(%edx),%eax
  1308.     pushl %eax
  1309.     call _cpy32_32
  1310.     movl $0,40(%esi)
  1311.     movl $0,44(%esi)
  1312.     movl $2,460(%esi)
  1313.     addl $40,%esp
  1314.     pushl %esi
  1315.     call _switch_context
  1316.     movl %ebx,%eax
  1317. L208:
  1318.     leal -20(%ebp),%esp
  1319.     popl %ebx
  1320.     popl %esi
  1321.     popl %edi
  1322.     leave
  1323.     ret
  1324. LC6:
  1325.     .ascii "clock: %lu ticks = %lu sec\12\0"
  1326.     .align 2,0x90
  1327. .globl _shut_down
  1328. _shut_down:
  1329.     pushl %ebp
  1330.     movl %esp,%ebp
  1331.     subl $4,%esp
  1332.     pushl %ebx
  1333.     movl $_process+916,%ebx
  1334.     testl %ebx,%ebx
  1335.     je L212
  1336.     .align 2,0x90
  1337. L216:
  1338.     cmpl $_process+7328,%ebx
  1339.     ja L212
  1340.     pushl %ebx
  1341.     call _free_process
  1342.     addl $4,%esp
  1343.     addl $916,%ebx
  1344.     jne L216
  1345. L212:
  1346.     cmpb $0,_opt_printall
  1347.     je L217
  1348.     movl _time_tic,%eax
  1349.     movl %eax,-4(%ebp)
  1350.     leal (%eax,%eax,4),%eax
  1351.     andl $2147483647,%eax
  1352.     movl $-1274330955,%edx
  1353.     mull %edx
  1354.     shrl $6,%edx
  1355.     movl %edx,-4(%ebp)
  1356.     pushl %edx
  1357.     movl _time_tic,%eax
  1358.     pushl %eax
  1359.     pushl $LC6
  1360.     call _printf
  1361.     addl $12,%esp
  1362. L217:
  1363.     call _clean_up
  1364.     movw 8(%ebp),%ax
  1365.     andl $65535,%eax
  1366.     pushl %eax
  1367.     call _protected_to_real
  1368.     movl -8(%ebp),%ebx
  1369.     leave
  1370.     ret
  1371. LC7:
  1372.     .ascii "warning: memaccess pointer is not valid\0"
  1373.     .align 2,0x90
  1374. .globl _getmem
  1375. _getmem:
  1376.     pushl %ebp
  1377.     movl %esp,%ebp
  1378.     subl $12,%esp
  1379.     pushl %edi
  1380.     pushl %esi
  1381.     pushl %ebx
  1382.     movl 8(%ebp),%esi
  1383.     movl 12(%ebp),%ebx
  1384.     cmpl %esi,556(%ebx)
  1385.     jb L219
  1386.     movl 548(%ebx),%edx
  1387.     movl %edx,-12(%ebp)
  1388.     addl %esi,548(%ebx)
  1389.     subl %esi,556(%ebx)
  1390.     jmp L220
  1391.     .align 2,0x90
  1392. L219:
  1393.     cmpb $0,464(%ebx)
  1394.     jge L221
  1395.     leal 65535(%esi),%eax
  1396.     movl %eax,%edi
  1397.     andl $-65536,%edi
  1398.     jmp L222
  1399.     .align 2,0x90
  1400. L221:
  1401.     leal 4095(%esi),%eax
  1402.     movl %eax,%edi
  1403.     andl $-4096,%edi
  1404. L222:
  1405.     leal -8(%ebp),%eax
  1406.     pushl %eax
  1407.     leal -4(%ebp),%eax
  1408.     pushl %eax
  1409.     pushl 484(%ebx)
  1410.     movl %edi,%eax
  1411.     addl 480(%ebx),%eax
  1412.     pushl %eax
  1413.     call _ResizeMem
  1414.     addl $16,%esp
  1415.     testl %eax,%eax
  1416.     je L223
  1417.     movl $-1,%eax
  1418.     jmp L230
  1419.     .align 2,0x90
  1420. L223:
  1421.     addl %edi,480(%ebx)
  1422.     movl 548(%ebx),%edx
  1423.     movl %edx,-12(%ebp)
  1424.     addl %esi,548(%ebx)
  1425.     movl %edi,%eax
  1426.     subl %esi,%eax
  1427.     addl %eax,556(%ebx)
  1428.     cmpb $0,_opt_memaccess
  1429.     jne L224
  1430.     testb $1,564(%ebx)
  1431.     jne L224
  1432.     movl 480(%ebx),%eax
  1433.     decl %eax
  1434.     pushl %eax
  1435.     pushl 476(%ebx)
  1436.     call _SetLimit
  1437.     addl $8,%esp
  1438. L224:
  1439.     movl 484(%ebx),%eax
  1440.     cmpl %eax,-4(%ebp)
  1441.     je L225
  1442.     movl -4(%ebp),%eax
  1443.     movl %eax,484(%ebx)
  1444. L225:
  1445.     movl 488(%ebx),%eax
  1446.     cmpl %eax,-8(%ebp)
  1447.     je L226
  1448.     movl -8(%ebp),%eax
  1449.     movl %eax,488(%ebx)
  1450.     pushl %eax
  1451.     pushl 472(%ebx)
  1452.     call _SetBaseAddress
  1453.     pushl 488(%ebx)
  1454.     pushl 476(%ebx)
  1455.     call _SetBaseAddress
  1456.     pushl 488(%ebx)
  1457.     movl 476(%ebx),%eax
  1458.     addl _sel_incr,%eax
  1459.     pushl %eax
  1460.     call _SetBaseAddress
  1461.     addl $24,%esp
  1462.     cmpb $0,_opt_memaccess
  1463.     je L226
  1464.     cmpb $0,_opt_printall
  1465.     je L226
  1466.     pushl $LC7
  1467.     call _puts
  1468.     addl $4,%esp
  1469. L226:
  1470.     cmpb $0,464(%ebx)
  1471.     jl L229
  1472.     cmpb $0,_opt_zero
  1473.     je L220
  1474. L229:
  1475.     pushl %edi
  1476.     pushl -12(%ebp)
  1477.     movzwl 476(%ebx),%eax
  1478.     pushl %eax
  1479.     call _bzero32
  1480. L220:
  1481.     movl -12(%ebp),%eax
  1482. L230:
  1483.     leal -24(%ebp),%esp
  1484.     popl %ebx
  1485.     popl %esi
  1486.     popl %edi
  1487.     leave
  1488.     ret
  1489. LC8:
  1490.     .ascii "RSX: end of do_exit4c() should never reached\0"
  1491.     .align 2,0x90
  1492. .globl _do_exit4c
  1493. _do_exit4c:
  1494.     pushl %ebp
  1495.     movl %esp,%ebp
  1496.     pushl %edi
  1497.     pushl %esi
  1498.     pushl %ebx
  1499.     movl 8(%ebp),%edi
  1500.     movl _npz,%eax
  1501.     movzbl 44(%eax),%esi
  1502.     xorl %ebx,%ebx
  1503.     .align 2,0x90
  1504. L235:
  1505.     movl _npz,%eax
  1506.     cmpl $0,576(%eax,%ebx,4)
  1507.     je L234
  1508.     pushl %ebx
  1509.     call _sys_close
  1510.     addl $4,%esp
  1511. L234:
  1512.     incl %ebx
  1513.     cmpl $40,%ebx
  1514.     jle L235
  1515.     movl _npz,%eax
  1516.     movl 448(%eax),%ebx
  1517.     testl %edi,%edi
  1518.     je L238
  1519.     movl %edi,468(%eax)
  1520.     jmp L239
  1521.     .align 2,0x90
  1522. L238:
  1523.     movl %esi,%edx
  1524.     sall $8,%edx
  1525.     movl %edx,468(%eax)
  1526. L239:
  1527.     movl _npz,%eax
  1528.     movl $1,460(%eax)
  1529.     orb $8,464(%eax)
  1530.     andl $-3,464(%eax)
  1531.     pushl %eax
  1532.     call _free_process
  1533.     movl _npz,%eax
  1534.     pushl 84(%eax)
  1535.     call _free_kernel_stack
  1536.     addl $8,%esp
  1537.     testb $1,465(%ebx)
  1538.     je L240
  1539.     pushl %esi
  1540.     call _shut_down
  1541.     addl $4,%esp
  1542. L240:
  1543.     cmpl $4,460(%ebx)
  1544.     jne L241
  1545.     movl $2,460(%ebx)
  1546. L241:
  1547.     pushl $18
  1548.     pushl %ebx
  1549.     call _send_signal
  1550.     pushl %ebx
  1551.     call _switch_context
  1552.     pushl $LC8
  1553.     call _puts
  1554.     pushl $0
  1555.     call _shut_down
  1556.     xorl %eax,%eax
  1557.     leal -12(%ebp),%esp
  1558.     popl %ebx
  1559.     popl %esi
  1560.     popl %edi
  1561.     leave
  1562.     ret
  1563. .comm _process,8244
  1564. .comm _npz,4
  1565. .lcomm _stack_used,8
  1566. .lcomm _kstk,32
  1567. .comm _go32_info_block,40
  1568.